package com.aids_malaria.adapter;


import android.content.Context;
import android.widget.CheckBox;

import com.aids_malaria.R;
import com.aids_malaria.base.BaseQuickAdapter;
import com.aids_malaria.base.BaseViewHolder;
import com.aids_malaria.http.response.WorkAreaResponse;

import java.util.List;

public class WorkAreaManagerAdapter extends BaseQuickAdapter<WorkAreaResponse.VillageDataBean> {

    public WorkAreaManagerAdapter(Context context, int layoutResID, List<WorkAreaResponse.VillageDataBean> data) {
        super(context, layoutResID, data);
    }

    @Override
    public void convert(BaseViewHolder holder, WorkAreaResponse.VillageDataBean item) {
        if (holder.getAdapterPosition() % 2 > 0){
            holder.getView(R.id.item).setBackgroundColor(mContext.getResources().getColor(R.color.c_item2));
        }else {
            holder.getView(R.id.item).setBackgroundColor(mContext.getResources().getColor(R.color.c_item1));
        }
        CheckBox cb_check = (CheckBox) holder.getView(R.id.cb_check);
        cb_check.setChecked(item.isCheck());
        holder.setText(R.id.tv_village,item.getVillage_name());
        holder.setText(R.id.tv_coordinate,item.getXy());

    }

}
